﻿using System;

using JetBrains.ProjectModel;
using JetBrains.ReSharper.Daemon;
using JetBrains.ReSharper.Psi;

namespace FinlogiK.ReSharperContrib
{
	/// <summary>
	/// 	Daemon stage for the 'Arrange static qualifier' code inspection.
	/// </summary>
	[DaemonStageAttribute(StagesBefore = new[] { typeof(LanguageSpecificDaemonStage) })]
	public sealed class AddStaticQualifierDaemonStage : IDaemonStage
	{
		#region Constructors

		/// <summary>
		/// 	Initializes a new instance of the <see cref = "AddStaticQualifierDaemonStage" /> class.
		/// </summary>
		public AddStaticQualifierDaemonStage()
		{
		}

		#endregion

		#region IDaemonStage Members

		/// <summary>
		/// 	Creates a code analysis process corresponding to this stage for analysing a file.
		/// </summary>
		/// <param name = "process"></param>
		/// <param name = "processKind"></param>
		/// <returns>
		/// 	Code analysis process to be executed or <c>null</c> if this stage is not available for this file.
		/// </returns>
		public IDaemonStageProcess CreateProcess(IDaemonProcess process, DaemonProcessKind processKind)
		{
			return new AddStaticQualifierDaemonStageProcess(process);
		}

        /// <summary>
        /// 	Check the error stripe indicator necessity for this stage after processing given <paramref name = "sourceFile" />
        /// </summary>
        /// <param name = "sourceFile"></param>
        /// <returns></returns>
	    public ErrorStripeRequest NeedsErrorStripe(IPsiSourceFile sourceFile)
	    {
            return ErrorStripeRequest.STRIPE_AND_ERRORS;
	    }

        /// <summary>
        /// 	Check the error stripe indicator necessity for this stage after processing given <paramref name = "projectFile" />
        /// </summary>
        /// <param name = "projectFile"></param>
        /// <returns></returns>
		public ErrorStripeRequest NeedsErrorStripe(IProjectFile projectFile)
		{
			return ErrorStripeRequest.STRIPE_AND_ERRORS;
		}

		#endregion
	}
}